< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03030201.xhp

(section: hour) (bookmark: bm_id3156042)
Hour function

Hour 関数

Hour Function [Runtime]
Hour 関数 [実行時](hd_id3156042.1)

Returns the hour from a time value that is generated by the TimeSerial or the TimeValue function.
TimeSerial ないし TimeValue 関数による時刻データのシリアル変換値を基に、該当時刻の時を示す数値を返します。(par_id3149346.2)

(/section: hour)

Syntax:
構文:(hd_id3147574.3)

Hour (Number)
Hour (Number)(par_id3147264.4)

Return value:
戻り値:(hd_id3145069.5)

Integer
整数(par_id3149670.6)

Parameters:
パラメータ:(hd_id3150359.7)

Number: Numeric expression that contains the serial time value that is used to return the hour value.
Number: 時刻 (時) 情報を返すために使われる時刻データのシリアル変換値を示す数値表式。(par_id3154366.8)

This function is the opposite of the TimeSerial function. It returns an integer value that represents the hour from a time value that is generated by the TimeSerial or the TimeValue function. For example, the expression
この関数は、TimeSerial 関数と逆方向の機能を担っています。この場合の戻り値としては、時刻データを TimeSerialTimeValue で変換した数値を基に、該当する時刻を示す整数値が返されます。こうした点は、下記のコードを実行してみると分かりやすいでしょう。(par_id3154909.9)

Print Hour(TimeSerial(12,30,41))
Print Hour(TimeSerial(12,30,41))(par_id3163798.10)

returns the value 12.
この場合の戻り値は 12 となります。(par_id3155132.11)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

Example:
例:(hd_id3147348.12)

Sub ExampleHour
Sub ExampleHour(par_id3146985.13)

Print "The current hour is " & Hour( Now )
Print "現在の時刻は" & Hour( Now )(par_id3156441.14)

End Sub
End Sub(par_id3153145.15)


< Prev / Next >